package com.ikun.search.controller;

import com.ikun.common.entity.Department;
import com.ikun.search.service.DepartmentService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 科室表 前端控制器
 *
 * @author Guio
 * @since 2024-02-26
 */
@RestController
@RequestMapping("search")
public class DepartmentController {

    @Resource
    private DepartmentService departmentService;

    /**
     * 查所有科室
     */
    @GetMapping("all-department")
    public ResponseEntity<List<Department>> getAllDepartment() {
        return ResponseEntity.ok(departmentService.list());
    }

}
